import json
import redis

# 发布消息
data = "w4edrfytguyhijnok"
def send(data):
    client = redis.Redis(host='39.105.153.251',password='@huqiao123')
    print(json.dumps(data))
    client.publish('test', json.dumps(data))
    print("发送成功")

send(data)